//<![CDATA[
if ((str.indexOf("/search?")!=-1)||(str.indexOf("archive.html")!=-1)) {
  document.write("<div style=\"text-align:center;\"><img alt='lỗi 404' src=\"https://lh3.googleusercontent.com/-P7EwggVOcrM/VGqsTFNoVfI/AAAAAAAAC0w/D_ymT4PH_RM/w500-h370-no/loi-404.png\" \/><br><br>Rất tiếc, trang mà bạn đang tìm không tồn tại trên webiste.<br> Click <a href=\"http://denhatnoithat.blogspot.com\">vào đây<\/a> để trở về trang chủ.<\/div>"); }

else {
var rcpage = new Array();
if (view=="full") {
var numposts = 20; // số bài viết hiển thị trên 1 trang
}
else {var numposts = 20;}

var numpage=totalPosts/numposts;
var lastnum = totalPosts%numposts;
if (lastnum==0) {numpage=numpage+1;}

for (var m=1;m<numpage;m++) {
var start=numposts*(m-1)+1;
rcpage[m] ="<script src=\"/feeds/posts/default"+textlabel+"?start-index="+start+"&max-results="+numposts+"&orderby=published&alt=json-in-script&callback=showrecentposts\"><\/script>";
}
if ((page>numpage)&&(page<numpage+1)&&(lastnum>0)) {
var numposts=lastnum;
start = totalPosts-lastnum+1;
document.write("<script src=\"/feeds/posts/default"+textlabel+"?start-index="+start+"&max-results="+numposts+"&orderby=published&alt=json-in-script&callback=showrecentposts\"><\/script>");
}
  else if ((page>numpage)||((page>numpage-1)&&(lastnum==0))){document.write("<div style=\"text-align:center;\"><img src=\"https://lh3.googleusercontent.com/-P7EwggVOcrM/VGqsTFNoVfI/AAAAAAAAC0w/D_ymT4PH_RM/w500-h370-no/loi-404.png\" \/><\/div>"); }
else {document.write(rcpage[page]); }

if (lastnum==0) {var pagelist=totalPosts/numposts;} else {var pagelist=numpage+1;}
var pagelist1 = parseInt(pagelist);

var npage = parseFloat(page);

if (page<=parseInt(pagelist)) {

if ((pagelist>=2)&&(pagelist1<6)) {

document.write("<div class=\"clear\"><\/div><div class=\"wp-pagenavi\"><span class=\"pages\">Page "+page+" of "+parseInt(pagelist)+"<\/span>");
for (var n=1;n<pagelist1+1;n++) {
if (n==npage) {var navpage="<span class=\"current\" >"+n+"<\/span>";} else {var navpage="<a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+n+"\">"+n+"<\/a>";}
document.write(navpage);
}
document.write("<\/div>");
}

if ((pagelist>=6)&&(page<4)) {
document.write("<div class=\"clear\"><\/div><div class=\"wp-pagenavi\"><span class=\"pages\">Page "+page+" of "+parseInt(pagelist)+"<\/span>");
for (var n=1;n<6;n++) {
if (n==npage) {var navpage="<span class=\"current\" >"+n+"<\/span>";} else {var navpage="<a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+n+"\">"+n+"<\/a>";}
document.write(navpage);
}
if (parseInt(pagelist)>5) { document.write("<a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+n+"\">»<\/a><a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+parseInt(pagelist)+"\">Last<\/a><\/div>"); } else {document.write("<\/div>");}
}

else if ((pagelist>=6)&&(page>3)&&(page<parseInt(pagelist)-2)) {
var f = page-3;
var first = page-2;
var last = first+5;
document.write("<div class=\"clear\"><\/div><div class=\"wp-pagenavi\"><span class=\"pages\">Page "+page+" of "+parseInt(pagelist)+"<\/span><a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page=1\">First<\/a><a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+f+"\">««<\/a>");
for (var n=first;n<last;n++) {
if (n==npage) {var navpage="<span class=\"current\" >"+n+"<\/span>";} else {var navpage="<a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+n+"\">"+n+"<\/a>";}
document.write(navpage);
}
document.write("<a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+n+"\">»»<\/a><a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+parseInt(pagelist)+"\">Last<\/a><\/div>");
}

else if ((pagelist>=6)&&(page>3)&&(page>parseInt(pagelist)-3)) {
var f = parseInt(pagelist)-5;
var first = parseInt(pagelist)-4;
var last = parseInt(pagelist)+1;
document.write("<div class=\"clear\"><\/div><div class=\"wp-pagenavi\"><span class=\"pages\">Page "+page+" of "+parseInt(pagelist)+"<\/span><a href=\"/"+textpage+"?v="+view+"&page=1\">First<\/a><a class=\"page larger\" href=\"/"+textpage+"?v="+view+"&page="+f+"\">««<\/a>");
for (var n=first;n<last;n++) {
if (n==npage) {var navpage="<span class=\"current\" >"+n+"<\/span>";} else {var navpage="<a href=\"/"+textpage+"?v="+view+"&page="+n+"\">"+n+"<\/a>";}
document.write(navpage);
}
document.write("<\/div>");
}
}
}
//]]>